<?php
require_once dirname(__FILE__).'/../bootstrap/unit.php';

$t = new lime_test(9);

$t->comment('::slugger()');
$t->is(Slug::slugger('Sensio'), 'sensio', '::slugger() converts all characters to lower case');
$t->is(Slug::slugger('sensio labs'), 'sensio-labs', '::slugger() replaces a white space by a -');
$t->is(Slug::slugger('sensio   labs'), 'sensio-labs', '::slugger() replaces several white spaces by a single -');
$t->is(Slug::slugger('  sensio'), 'sensio', '::slugger() removes - at the beginning of a string');
$t->is(Slug::slugger('sensio  '), 'sensio', '::slugger() removes - at the end of a string');
$t->is(Slug::slugger('paris,france'), 'paris-france', '::slugger() replaces non-ASCII characters by a -');
$t->is(Slug::slugger('sensio  2a'), 'sensio-2a', '::slugger() keep digits');

if (function_exists('iconv'))
{
    $t->is(Slug::slugger('Développeur Web'), 'developpeur-web', '::slugger() removes accents');
    $t->is(Slug::slugger('Imágen1'), 'imagen-1', '::slugger() removes accents');
}
else
{
    $t->skip('::slugify() removes accents - iconv not installed');
    $t->skip('::slugify() removes accents - iconv not installed');
}

?>
